/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Modelos;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author luisramirezmartinez SAMI 2011
 *
 */
@Entity
@Table(name = "tbl_pantallas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TblPantallas.findAll", query = "SELECT t FROM TblPantallas t"),
    @NamedQuery(name = "TblPantallas.findByIdpantalla", query = "SELECT t FROM TblPantallas t WHERE t.idpantalla = :idpantalla"),
    @NamedQuery(name = "TblPantallas.findByPantalla", query = "SELECT t FROM TblPantallas t WHERE t.pantalla = :pantalla"),
    @NamedQuery(name = "TblPantallas.findByNombre", query = "SELECT t FROM TblPantallas t WHERE t.nombre = :nombre"),
    @NamedQuery(name = "TblPantallas.findByDescripcion", query = "SELECT t FROM TblPantallas t WHERE t.descripcion = :descripcion"),
    @NamedQuery(name = "TblPantallas.findByEstatus", query = "SELECT t FROM TblPantallas t WHERE t.estatus = :estatus")})
public class TblPantallas implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Id_pantalla")
    private Integer idpantalla;
    @Basic(optional = false)
    @Column(name = "Pantalla")
    private String pantalla;
    @Column(name = "Nombre")
    private String nombre;
    @Column(name = "Descripcion")
    private String descripcion;
    @Column(name = "Estatus")
    private Boolean estatus;
    @Column(name = "TblPantallasPerfiles")
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tblpantallasIdpantalla")
    private Collection<TblPantallasPerfiles> tblPantallasPerfilesCollection;
    
    public TblPantallas(){

    }

    public TblPantallas(Integer idpantalla) {
        this.idpantalla = idpantalla;
    }

    public TblPantallas(Integer idpantalla, String pantalla) {
        this.idpantalla = idpantalla;
        this.pantalla = pantalla;
    }

    public Integer getIdpantalla() {
        return idpantalla;
    }

    public void setIdpantalla(Integer idpantalla) {
        Integer oldIdpantalla = this.idpantalla;
        this.idpantalla = idpantalla;
        changeSupport.firePropertyChange("idpantalla", oldIdpantalla, idpantalla);
    }

    public String getPantalla() {
        return pantalla;
    }

    public void setPantalla(String pantalla) {
        String oldPantalla = this.pantalla;
        this.pantalla = pantalla;
        changeSupport.firePropertyChange("pantalla", oldPantalla, pantalla);
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        String oldNombre = this.nombre;
        this.nombre = nombre;
        changeSupport.firePropertyChange("nombre", oldNombre, nombre);
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        String oldDescripcion = this.descripcion;
        this.descripcion = descripcion;
        changeSupport.firePropertyChange("descripcion", oldDescripcion, descripcion);
    }

    public Boolean getEstatus() {
        return estatus;
    }

    public void setEstatus(Boolean estatus) {
        Boolean oldEstatus = this.estatus;
        this.estatus = estatus;
        changeSupport.firePropertyChange("estatus", oldEstatus, estatus);
    }

    @XmlTransient
    public Collection<TblPantallasPerfiles> getTblPantallasPerfilesCollection() {
        return tblPantallasPerfilesCollection;
    }

    public void setTblPantallasPerfilesCollection(Collection<TblPantallasPerfiles> tblPantallasPerfilesCollection) {
        Collection<TblPantallasPerfiles> oldTblPantallasPerfilesCollection=this.tblPantallasPerfilesCollection;
        this.tblPantallasPerfilesCollection = tblPantallasPerfilesCollection;
        changeSupport.firePropertyChange("TblPantallasPerfiles", oldTblPantallasPerfilesCollection, tblPantallasPerfilesCollection);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpantalla != null ? idpantalla.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblPantallas)) {
            return false;
        }
        TblPantallas other = (TblPantallas) object;
        if ((this.idpantalla == null && other.idpantalla != null) || (this.idpantalla != null && !this.idpantalla.equals(other.idpantalla))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Modelos.TblPantallas[ idpantalla=" + idpantalla + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
